package com.vermicelli.mapper;

import com.usian.articles.Articles;
import com.usian.column.Collection;
import com.usian.dz.Dz;
import com.usian.user.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CollectionMapper {
    @Select("select * from collection where user_id = #{id}")
    List<Collection> selectList(Integer id);
    @Select("select * from articles where id = #{articlesId}")
    Articles selectById(Integer articlesId);
    @Select("delete from collection where articles_id = #{id} and user_id = #{userid}")
    Object del(Integer id,Integer userid);
    @Select("select * from dz where hid = #{id} and status =#{status}")
    List<Dz> comments(Integer id,Integer status);
    @Select("select * from tb_user where id = #{userId}")
    User selectUserOne(Integer userId);
    @Insert("insert into dz(userId, context, hid,status) values(#{userId}, #{context}, #{hid},#{status})")
    Integer addComment(Dz dz);

}
